package org.millioncall.yueyoga.admin.service.impl;

import java.util.List;
import java.util.Map;

import org.millioncall.openplatform.common.PaginatedList;
import org.millioncall.yueyoga.admin.dao.GoodTypeDAO;
import org.millioncall.yueyoga.admin.model.GoodType;
import org.millioncall.yueyoga.admin.service.GoodTypeService;
import org.springframework.stereotype.Service;

@Service
public class GoodTypeServiceImpl implements GoodTypeService {
	public GoodTypeDAO goodTypeDAO;
	
	public GoodTypeDAO getGoodTypeDAO() {
		return goodTypeDAO;
	}

	public void setGoodTypeDAO(GoodTypeDAO goodTypeDAO) {
		this.goodTypeDAO = goodTypeDAO;
	}

	@Override
	public boolean deleteById(Integer id) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean deleteByIds(String ids) {
		String[] strIds=ids.split(",");
		int count= goodTypeDAO.deleteByIds(strIds);
		if(count>0){
			return true;
		}else{
			return false;
		}
	}

	@Override
	public GoodType findGoodTypeById(Integer id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public PaginatedList<GoodType> findGoodTypeInPage(Map<String, Object> map,
			int start, int limit) {
		// TODO Auto-generated method stub
		return goodTypeDAO.findGoodTypeInPage(map, start, limit);
	}

	@Override
	public List<GoodType> findAll() {
		// TODO Auto-generated method stub
		return goodTypeDAO.findAll();
	}

	@Override
	public boolean save(GoodType goodType) {
		int i=goodTypeDAO.save(goodType);
		if(i>0){
			return true;
		}else{
			return false;
		}
	}

	@Override
	public boolean update(GoodType goodType) {
		// TODO Auto-generated method stub
		return false;
	}

}
